/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Excersize2_Swing;

/**
 *
 * @author אלירן
 */
public class SwingConstants {

    public static enum BattleshipTypes {

        AIRCRAFT_CARRIER, BATTLESHIP, SUBMARINE, CRUSIER, DESTROYER
    }

    static public int getBattleshipSize(BattleshipTypes bt) {
        switch (bt) {
            case AIRCRAFT_CARRIER:
                return 5;
            case BATTLESHIP:
                return 4;
            case SUBMARINE:
                return 3;
            case CRUSIER:
                return 3;
            case DESTROYER:
                return 2;
        }
        return 0;
    }

    static public String getBattleshipString(BattleshipTypes battleshipTypes) {
        switch (battleshipTypes) {
            case AIRCRAFT_CARRIER:
                return "aircraft carrier";
            case BATTLESHIP:
                return "battleship";
            case SUBMARINE:
                return "submarine";
            case CRUSIER:
                return "cruiser";
            case DESTROYER:
                return "destroyer";
        }
        return "";
    }

    static public BattleshipTypes getBattlehipTypeByString(String name) {
        if (name.equals("aircraft carrier")) {
            return BattleshipTypes.AIRCRAFT_CARRIER;
        }
        if (name.equals("battleship")) {
            return BattleshipTypes.BATTLESHIP;
        }
        if (name.equals("submarine")) {
            return BattleshipTypes.SUBMARINE;
        }
        if (name.equals("cruiser")) {
            return BattleshipTypes.CRUSIER;
        }
        if (name.equals("destroyer")) {
            return BattleshipTypes.DESTROYER;
        }
        return null;

    }
}
